import React, { Component } from "react";

class Demo extends Component {
  constructor(props) {
    super(props);
    console.log("1、Demo组件");
  }
  static getDeriveStateFromProps(props, state) {
    console.log("2、Demo组件");

    return null;
  }
  render() {
    console.log("3、Demo组件render");

    return (
      <div>
        <Demo></Demo>
      </div>
    );
  }
  componentDidMount() {
    console.log("1、Demop组件componentDidMount");
  }
}
class App extends Component {
  constructor(props) {
    super(props);
    console.log("1、App组件");
  }
  static getDeriveStateFromProps(props, state) {
    console.log("2、App组件");

    return null;
  }
  render() {
    console.log("3、App组件render");

    return (
      <div>
        <Demo></Demo>
      </div>
    );
  }
  componentDidMount() {
    console.log("1、App组件componentDidMount");
  }
}

export default App;
